package com.haozi.ehub.core.security;

import com.haozi.ehub.core.util.Md5Utils;
import lombok.extern.slf4j.Slf4j;
import org.springframework.security.crypto.password.PasswordEncoder;

/**
 * Security使用Md5进行密码验证，由于业务原因暂停使用
 * @author ：terry
 * @date ：Created in 2020/6/16 14:58
 * @version: 1.0
 */
@Slf4j
@Deprecated
public class Md5SecurityEncoder implements PasswordEncoder {
    @Override
    public String encode(CharSequence charSequence) {
        return Md5Utils.encode(charSequence.toString());
    }

    @Override
    public boolean matches(CharSequence charSequence, String s) {
        return s.equals(Md5Utils.encode(charSequence.toString()));
    }
}
